﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="Sdepci.InfoCode.Web.Authority.UserList" %>
<%@ Register src="../Includes/VerifyLoginState.ascx" tagname="VerifyLoginState" tagprefix="uc1" %>
<%@ Register src="../Includes/Pagination.ascx" tagname="Pagination" tagprefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>用户管理</title>
    <link rel="stylesheet" type="text/css" href="../Css/Style.css" />
    <link rel="stylesheet" type="text/css" href="../Css/Backstage.css" />
    <script type="text/javascript" src="../Javascript/MyGrid.js"></script>
    <script type="text/javascript" src="../Javascript/Pagination.js"></script>
    <script type="text/javascript">
    function SetUserRole(userId)
    {
        var result = window.showModalDialog("UserRole.aspx?UserId=" + userId, window, "dialogWidth:350px;dialogHeight:320px");
        if (result != undefined && result == true)
        {
            document.location = document.location;
        }
    }
    
    function UserSynchronize()
    {
        if (window.confirm("您确认要进行域用户同步吗？\n注意：该操作非常耗费，且操作过程中不可取消！"))
        {
            var result = window.showModalDialog("UserSynchronize.aspx", window, "dialogWidth:450px;dialogHeight:220px");
            if (result != undefined && result == true)
            {
                document.location = "UserList.aspx";
            }
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:VerifyLoginState ID="VerifyLoginState1" runat="server" />
    <div id="container">
        <div id="editregion">
            <table style="width: 100%;">
                <caption>查询选项</caption>
                <tr>
                    <td class="label">用户证档号：</td>
                    <td class="input">
                        <asp:TextBox ID="UserId" CssClass="text" MaxLength="20" runat="server"></asp:TextBox>
                    </td>
                    <td class="label">用户姓名：</td>
                    <td class="input">
                        <asp:TextBox ID="UserName" CssClass="text" MaxLength="20" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="label">用户角色：</td>
                    <td class="input">
                        <asp:DropDownList ID="RoleGuid" runat="server"></asp:DropDownList>
                    </td>
                    <td class="input" colspan="2" style="text-align: center;">
                        <asp:Button ID="btnSearch" CssClass="button" runat="server" Text="查询" onclick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="listregion">
            <table style="width: 100%;" id="tblCheck">
                <caption>用户管理</caption>
                <thead>
                    <tr>
                        <td style="width: 10%;">
                            <label id="lblCheck" title="false" style="cursor: pointer; padding: 0px 2px 2px 2px;" onclick="javascript:SelectAll('lblCheck','ItemId','tblCheck');">全选</label>
                        </td>
                        <td style="width: 15%;">用户证档号</td>
                        <td style="width: 10%;">用户姓名</td>
                        <td style="width: 15%;">用户编码</td>
                        <td style="width: 25%;">部门信息</td>
                        <td style="width: 15%;">用户角色</td>
                        <td style="width: 10%;">修改角色</td>
                    </tr>
                </thead>
                <tbody id="MyGridTemplate" runat="server">
                    <tr>
                        <td><input type="checkbox" name="ItemId" value="{UserId}" onclick="javascript:CancelAll('lblCheck','ItemId','tblCheck');" /></td>
                        <td>{UserId}</td>
                        <td>{UserName}</td>
                        <td>{UserCode}</td>
                        <td>{DeptInfo}</td>
                        <td>{RoleName}</td>
                        <td>[<a href="javascript:SetUserRole('{UserId}');">修改</a>]</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="paginationregion">
            <uc2:Pagination ID="Pagination1" runat="server" />
        </div>
        <div id="buttonregion">
            <input type="button" id="btnSynchronize" class="button" value="同步域用户" onclick="javascript:UserSynchronize();" />
            <asp:Button ID="btnDelete" CssClass="button" runat="server" Text="删除" UseSubmitBehavior="false" OnClientClick="javascript:if(!BeforeDelete('ItemId')) return false;" onclick="btnDelete_Click" />
        </div>
        <div id="tipsregion">
            如果要进行“同步域用户”操作，需要耗费很长时间及大量服务器资源，请确保系统状态正常及网络畅通！<br />
        </div>
    </div>
    </form>
</body>
</html>
